<div class="window">
	<div class="title">New task</div>
	<div class="content">
		<?php echo $form->create('Task', array('type' => 'file')); ?>
		<?php echo $form->input('name'); ?>
		<?php echo $form->input('desc'); ?>
		<?php echo $form->input('priority', array('options' => array(1 => 'low', 2 => 'medium', 3 => 'high'), 'default' => 2)); ?>
		<?php echo $form->input('performer_id', array('default' => $current_user['User']['id'])); ?>
		<div class="files" style="margin: 0 0 0 160px;">
			<div class="file"><?php echo $form->file('Files.file', array('name' => 'data[Files][]')); ?></div>
		</div>
		<div id="attach-another-file" style="margin: 0 0 0 160px;">
			<a href="#attach-another-file">Attach another file</a>
		</div>
		<?php echo $form->end('Submit'); ?>
	</div>
</div>
<script>
	$("#attach-another-file a").click(function(){
		
		$("div.files").append("<div class=\"file\"><input type=\"file\" name=\"data[Files][]\" /></div>");
		
		return false;
	});
</script>